/*
 * @Author: AHANG
 * @Date: 2022-04-06 14:18:36
 * @LastEditors: AHANG
 * @LastEditTime: 2022-07-16 15:22:09
 * @Description:
 */
//创建整个应用的路由器
//创建路由器
import VueRouter from "vue-router";
// eslint-disable-next-line no-unused-vars
export default new VueRouter({
  // eslint-disable-next-line no-unused-vars
  scrollBehavior(to, from, savedPosition) {
    return { x: 0, y: 0 };
  },
  routes: [
    {
      path: "/",
      redirect: "login",
    },
    {
      path: "/login",
      name: "login",
      component: () => import("../views/login.vue"),
    },
    {
      path: "/Home",
      name: "Home",
      component: () => import("../views/Home.vue"),
      meta: {
        requireAuth: true,
      },
      children: [
        {
          path: "Info",
          name: "Info",
          components: { Info: () => import("../views/Info.vue") },
        },
        {
          path: "Maps",
          name: "Maps",
          components: { Maps: () => import("../views/Map.vue") },
        },
      ],
    },
  ],
});
